package com.ilxqx.framework.security.service;

import com.ilxqx.framework.security.util.AuthUtils;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

/**
 * 访问控制服务
 * @author venus
 */
@Service
public class AccessService {

    /**
     * 是否可以访问该请求
     * @param request 请求对象
     * @return bool
     */
    public boolean canAccess(HttpServletRequest request) {
        return AuthUtils.loggedUserHasPermission(request.getRequestURI(), request.getMethod());
    }

}
